Ext.define('appmod.view.knowledge.usergroup.Dashboard', {
    extend: 'Ext.grid.Panel',
    alias:[
		'widget.knowledge.usergroup.dashboard',
		'widget.knowledge-usergroup-dashboard'
	],
    margins:"5 5 0 5",
    region : 'center',
    title: '用户组',
	requires:[
		'Ext.ux.form.SearchField'
	],	

    initComponent: function() {
        var me = this;

        Ext.applyIf(me, {
            columns: [
                {
                    xtype: 'gridcolumn',
                    dataIndex: 'groupName',
                    minWidth:150,
					text: '用户组名称'
                },
                {
                    xtype: 'gridcolumn',
                    dataIndex: 'desc',
					flex:1,
                    text: '描 述'
                }
            ],
            viewConfig: {

            },
            selModel: Ext.create('Ext.selection.CheckboxModel', {
                allowDeselect: true
            }),            
            dockedItems: [
                {
                    xtype: 'pagingtoolbar',
                    width: 360,
					store:me.store,
                    displayInfo: true,
                    dock: 'bottom'
                },
                {
                    xtype: 'toolbar',
                    dock: 'top',
                    items: [
	                    {
	                        xtype: 'button',
	                        text: '新增用户组',
							action : 'createUserGroup'
	                    },
	                    {
	                        xtype: 'button',
	                        text: '更新用户组',
							action : 'updateUserGroup'
	                    },
	                    {
	                        xtype: 'button',
	                        text: '删除用户组',
							action : 'deleteUserGroup'
	                    },
						{
	                        xtype: 'button',
	                        text: '设定用户成员',
							action : 'assignUserMember'
	                    }
						,'-',
						{
					        width: 400,
					        fieldLabel: '用户查询',
					        labelWidth: 80,
					        xtype: 'searchfield'
				        }						
                    ]
                }
            ],
			listeners:{
				
			}
        });

        me.callParent(arguments);
    },
	
	bindStore:function(store) {
		var me = this;
		var pagingbar = me.down('pagingtoolbar');
		pagingbar.bindStore(store);
		
		var searchField = me.down('searchfield');
		searchField.bindStore(store);
		me.callParent(arguments);		
	}
	
	
	
	
});